import { _decorator, Component, Label, Node, Sprite } from 'cc';
import { UIComponent } from '../../../../Framework/Scripts/Managers/UIComponent';
const { ccclass, property } = _decorator;

@ccclass('GameRankItem2')
//每日挑战的 大神和休闲的次数
export class GameRankItem2 extends UIComponent {
    labRank: Label;
    spRank: Sprite;
    sphead: Sprite;
    lbaName: Label;
    labNumXX: Label; //休闲挑战次数
    labNumDS: Label;  //大神挑战次数
    protected onLoad(): void {
        this.InitUI();
    }

    start() {
        this.InitData();
    }

    protected onDestroy(): void {
        this.unRegisterEvent();
    }

    private InitUI(){
        this.registerEvent();

        this.labRank = this.ViewComponent('labRank',Label);
        this.spRank = this.ViewComponent('spRank',Sprite);
        this.setHeadMat(this.sphead,1);
        this.sphead = this.ViewComponent('head/spHead',Sprite);
        this.lbaName = this.ViewComponent('labName',Label);

        this.labNumXX = this.ViewComponent('spBg1/labNum1',Label);
        this.labNumDS = this.ViewComponent('spBg2/labNum2',Label);

    }

    private InitData(){
   
    }

    private registerEvent(){
        // globalThis.gameMgr._eventTarget.on(EventMsgKes.loading,this.onLoadingPro,this);
    }

    private unRegisterEvent(){
        // globalThis.gameMgr._eventTarget.off(EventMsgKes.loading,this.onLoadingPro,this);
    }
}
